import Vue from 'vue'
import Router from 'vue-router'

import Home from '../pages/Home.vue'
import About from '../components/main/About.vue'
import Posts from '../components/main/Posts.vue'
import Detail from '../components/main/detail/Detail.vue'

Vue.use(Router)

export default new Router({
    routes:[
        {
            path: '/',
            component: Home,
            redirect: 'posts',
            children: [
                {
                    path: 'posts',
                    component: Posts,
                },
                {
                    path:'about',
                    component: About,
                },
                {
                    name: 'detail',
                    path: '/detail/:id',
                    component: Detail,
                },
            ]
        },
    ]
})